package com.example.beauty.controller;

import com.example.beauty.entity.Order;
import com.example.beauty.resp.RespModel;
import com.example.beauty.service.OrderService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author qin
 * @create 2022--09--15--14:50
 */
@RestController
@RequestMapping("/order")
public class OrderController {

    @Resource
    private OrderService orderService;

    @GetMapping("/createOrder")
    public RespModel createOrder(String token, Order order) {
//        System.out.println("创建预约订单：" + order + "，token=" + token);
        return orderService.createOrder(token, order);
    }
    @GetMapping("/getAll")
    public RespModel getAllOrder(String token, String orderState){
        System.out.println(token);
        return orderService.getAllOrder(token, orderState);
    }
}
